package com.hornsun.constant;

/**
 * Created by cwc on 2016/11/26 0026.
 */
public class Error extends AbstractError {
    /*20 开头*/
    public static final AbstractError USERNAME_OR_PWD_NOT_CORREXT = new Error(23, "用户名称或密码不正确");
    public static final AbstractError LOGIN_PARAMS_DESCRYPT_EXCEPTION = new Error(24, "登录账户参数解析异常");
    public static final AbstractError USER_LOGOUT_FAILED = new Error(25, "用户登出失败");
    public static final AbstractError USER_LOGIN_MODIFY_TIME_EROR = new Error(26, "修改上次登录时间失败");
    public static final AbstractError WECHAT_LOGIN_ERROR = new Error(27, "微信账号登录未知错误");

    static {
        putChildEnumIntoMap(Error.class);
    }

    private Error(int errorCode, String errorInfo) {
        super(errorCode, errorInfo);
    }

    public static AbstractError fromCode(Integer errorCode) {
        return getEnumByErrorCode(errorCode + 20);
    }
}